<script setup lang="ts">
import { useRouter } from 'vue-router'
import { ref } from 'vue'
import LoginLeft from '../../components/LoginLeft.vue'

const router = useRouter()
let rt = router.currentRoute.value.fullPath === '/web/register/student' ? 0 : 1

const registerType = ref(rt)

function changeRegisterType() {
  registerType.value = registerType.value == 0 ? 1 : 0
}
</script>

<template>
  <!-- Main -->
  <div class="d-md-flex h-md-100 align-items-center">
    <LoginLeft/>
    <div class="col-md-6 p-0 bg-white h-md-100 loginarea">
      <div class="d-md-flex align-items-center h-md-100 p-5 justify-content-center">
        <div class="border rounded p-5">
          <ul class="nav nav-tabs mb-3">
            <li class="nav-item">
              <RouterLink
                to="/web/register/student"
                class="nav-link"
                :class="registerType == 0 ? 'active' : ''"
                @click="changeRegisterType"
                >学生用户</RouterLink
              >
            </li>
            <li class="nav-item">
              <RouterLink
                to="/web/register/organize"
                class="nav-link"
                :class="registerType == 1 ? 'active' : ''"
                @click="changeRegisterType"
                >组织/商家</RouterLink
              >
            </li>
          </ul>
          <h3 class="mb-4 text-center">注 册</h3>
          <RouterView />
          <small class="d-block mt-4 text-center">
            <RouterLink to="/web/login">去登录</RouterLink>
          </small>
        </div>
      </div>
    </div>
  </div>
  <!-- End Main -->
</template>
